package com.v2.k50;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * 测试父类没有@component，只有@Autowired看能不能注入   也是能注入的
 */
public class Test {


	public static void main(String[] args) {

		AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(AppConfig.class);

		System.out.println(applicationContext.getBean(Person.class));
		Student2 student2 = (Student2) applicationContext.getBean("student2");
		student2.fun();

	}

}
